package com.imooc.long5zb.rest;

import com.imooc.long5zb.entity.User;
import com.imooc.long5zb.dao.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserRepository userRepository;

    @PostMapping("/user/add")
    public User add(User user) {
        User saveUser = userRepository.save(user);
        return saveUser;
    }
}
